<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>修改密码</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script src="Bootstrap/js/jquery-1.11.1.min.js"></script>
<link href="Bootstrap/css/bootstrap.min.css" rel="stylesheet">
<script src="Bootstrap/js/bootstrap.min.js"></script>
 <script type="text/javascript">
//提交注册90	
		   $(function(){
			  $("#btn").click(function(){
					 var oldPwd = $("#oldpassword").val();
					 var newPwd = $("#new_password").val();
				     var user = JSON.parse(localStorage.user);
				  	if(oldPwd != user.password){
						return false;
					}
					$.ajax({
						url:"http://localhost:8080/updatePassword?id="+user.id+"&newPassword="+newPwd,
						type:"post",
						success:function (data) {
							if(data == 1){
								alert("修改成功");
							}else{
								aleret("修改失败");
							}
						}
					})
			  });
		   });
    </script>
<style type="text/css">
body,html {
	font-family: "微软雅黑";
	color: gray;
}

.reg-info {
	color: red;
	margin: 0 auto; width：100 %;
	text-align: center;
}
.my-center {
	background: #B22222;
	text-align: center;
}
.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover {
border: 0px;
	background-color:#33CCCC;
}
 </style>
 </head>
<body>
	<a class="list-group-item active my-center">
	<span class="glyphicon glyphicon-chevron-left" style="float: left;" onclick="javascript:history.back(-1);">
	</span>修改密码</a>
	<br>
	<div id="form">
		<form action="../index.html">
			<div class="input-group username">
				<span class="input-group-addon "><span
					class="glyphicon glyphicon-phone"></span></span></span><input type="text"
					class="form-control" id="oldpassword" placeholder="请输入旧密码">
			</div><br>
			<div class="input-group password">
				<span class="input-group-addon "><span
					class="glyphicon glyphicon-pencil"></span></span> <input type="password"
					class="form-control" id="new_password" placeholder="请输入新密码">
			</div><br>
			<div class="input-group password">
				<span class="input-group-addon "><span
					class="glyphicon glyphicon-pencil"></span></span> <input type="password"
					class="form-control" id="new_okpassword" placeholder="请输入新密码">
			</div><br>
			<div class="reg-info" id="warning">&nbsp;</div>
			<input type="button" class="btn btn-primary btn-sm btn-block update-but" id="btn"style="background-color: #33CCCC;border: 0px"
				value="确定">
		</form>
	</div>
</body>
</html>